/*
 * Public Credit Information Sharing Platform(PCISP).
 * Copyright (c) 2019-2020 jsxzkingdee and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * Please visit https://www.zhengxinsoft.com if you need additional information or have any questions.
 */

package com.platform.enums;

import com.platform.comm.constants.EnumOption;
import com.platform.comm.enums.IDictEntry;
import com.platform.comm.enums.IEnum;
import com.platform.comm.enums.IEnumItem;
import com.platform.comm.enums.IEnumOption;

import java.util.Arrays;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * Description: 报告类型
 *
 * @author libin created on 2020/5/23.
 */
@EnumOption(name = "evalReportType")
public enum EvalReportType implements IEnum<String>, IDictEntry, IEnumItem, IEnumOption<String> {
    /**
     * Report
     */
    R("信用报告"),

    /**
     * Verification
     */
    V("核查报告");

    private final String text;

    EvalReportType(String text) {
        this.text = text;
    }

    @Override
    public String getKey() {
        return name();
    }

    @Override
    public String getValue() {
        return text;
    }

    @Override
    public Object getData() {
        return text;
    }

    @Override
    public String getText() {
        return text;
    }

    @Override
    public boolean is(String key) {
        if (Objects.isNull(key)) {
            return false;
        }
        return name().equals(key);
    }

    @Override
    public String key() {
        return name();
    }

    @Override
    public String value() {
        return text;
    }

    @Override
    public Map<String, String> enums() {
        return Arrays.stream(values()).collect(Collectors.toMap(IEnumOption::key, IEnumOption::value));
    }
}
